#ifndef __SENDER_FORWARD_H__
#define __SENDER_FORWARD_H__

#define MAX_RX_QUEUE_PER_LCORE 16
#define MAX_TX_QUEUE_PER_PORT 16
#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1

#define MAX_PKT_BURST 128
#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
#define MEMPOOL_CACHE_SIZE 256

/*
 * Configurable number of RX/TX ring descriptors
 */
#define RTE_TEST_RX_DESC_DEFAULT 1024
#define RTE_TEST_TX_DESC_DEFAULT 1024
#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1


#define SEN_PACKET_BRUST 7
#define CREATE_SAMPLE_PACKET_LENGTH 1400
#define IPV4  0x0800
#define NEED_FORWARD_PORTID 0
#define DONT_NEED_FORWARD_IP 0xC0A802D9  //不需要转发的ip地址是192.168.2.217
#define FIX_PACKET_BYTE 1400*100


/* List of queues to be polled for a given lcore. 8< */
struct lcore_queue_conf {
	unsigned n_rx_port;
	unsigned rx_port_list[MAX_RX_QUEUE_PER_LCORE];
} __rte_cache_aligned;


 struct lcore_queue_stat {
	uint64_t first_packet_tsc;
    uint64_t cur_tsc;
    uint64_t packet_count;
    uint64_t tx_rate;
    uint64_t tx_bytes;//单个核的传输的字节数
    uint32_t qlen;
} __rte_cache_aligned;

//流状态数据保存
 struct flow_info { 
    uint8_t last_ecn_type; //上一次的ecn状态
    uint8_t bset;
    uint32_t bit_cnt;//bset计数器
    uint32_t tq_cnt;//tx_rate和qlen的计数器
	uint64_t last_deq_tsc; //该包的出队时间
    uint64_t tx_bytes;//出队时总的传输字节数
    double tx_rate[7];//单位为Mbps
    uint32_t qlen[7];//包的个数为单位
} __rte_cache_aligned;

#endif